cc.Class({
    extends: cc.Component,

    properties: {

        bgAudio:{
            default:null,
            url:cc.AudioClip,
        },
        audioOn:cc.Node,
        audioOff:cc.Node,
        backToMenu:cc.Node,
    },
    onLoad:function(){
        cc.audioEngine.playMusic(this.bgAudio, true);
        cc.director.preloadScene('welcome');
        this.backToMenu.on("touchstart",this.back);
        this.audioOn.on("touchstart",this.onAudio);
        this.audioOff.on("touchstart",this.offAudio);
    },
    back: function() {
        cc.audioEngine.pauseMusic();
        cc.director.loadScene('welcome');
    },
    onAudio:function(){
        // cc.audioEngine.playMusic(this.bgAudio, true);   
    },
    offAudio:function(){
        // cc.audioEngine.pauseMusic();
    },

});
